/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

var dhxWins;
var idPrefix = 1;
var x=320;
var y=200;

function windowDoOnLoad() {
    dhxWins = new dhtmlXWindows();
    //dhxWins.enableAutoViewport(false);
    dhxWins.attachViewportTo("winVP");
    dhxWins.setImagePath("dhtmlxWindows/codebase/imgs/");
    creatWindow();
}

function creatWindow() {
   try{
   
    var id = "userDesktop1";
    var w=250;
    var h=150;
    
    
    //;
    var why=dhxWins.createWindow(id, x, y, w, h);
    dhxWins.window(id).setText("Window");
    //var btn = dhxWins.window(id).button("tray");
   // dhxWins.window(id).addUserButton("tray", 9, "Tray", "tray");
    //var a =why.attachF
    //    var html1="        <div><form>" +"<input type='text' name='link'/>" +"<input type='submit' name='Change'/>"+" </form>"+"</div>";
        //dhxWins.window(id).innerHTML+=html1;
    //dhxWins.window(id).keepInViewport(true);
    //document.getElementById("win_x").value = x + 8;
    //document.getElementById("win_y").value = y + 6;
    x+=8;
    y+=8;
    }catch(e) {
      alert(e);
    }
}